ABOUTDEVELOPERS |
SpatialStream® Code Examples
City Identify
Using City Boundaries, GetByGeometry, and GetMap SpatialStream® components, you can display city boundaries in your mapping application and use server-side highlight techniques to provide identify functionality. This example will demonstrate how to display city boundaries and add highlight behavior with information return in a balloon. The City Boundaries data component gives you access to nationwide city boundaries. The GetByGeometry component returns features at the mouse-click location, and GetMap displays the boundaries and the identified feature.
The advantage of the server-side highlight technique is that it gives you highly responsive interactivity with complex features and/or large data sets. City Boundaries | GetMap | GetByGeometry
var city = new Dmp.Layer.WMSLayer("boundary", "SS", {
ignoreHoles: true, antiAlias: true });city.addChild("cityPoly", "DMP_LICENSE/City", "$(ACCOUNT_FOLDER)SLD/SimpleBoundary.sld.xml", { zoomRange: { }); min: 10, max: 19 } city.addChild("cityLabel", "DMP_LICENSE/City", "$(ACCOUNT_FOLDER)SLD/CityLabel.sld.xml", { zoomRange: { }); min: 12, max: 19 } map.addLayer(city); //---------------- var url = "getByGeometry.aspx" + "?returnGeoType=1" + "&dataSource=DMP_LICENSE/CITY" + "&Geo=POINT(" + latLong.Longitude + " " + latLong.Latitude + ")" + "&fields=NAME,_DMP_ID"; Dmp.Env.Connections["SS"].getJson(url, successCallback, errorCallback); Run Sample View Video Back To Index |